// Author: wsfuyibing <682805@qq.com>
// Date: 2025-05-15

package list

import (
	"server/app/http/models"
	"server/app/kind"
)

// Response
// 出参.
type Response struct {
	Id          int64
	Enabled     kind.Enabled
	EnabledFlag string
	EnabledText string
	EnabledYes  bool
	Sort        int
	Title       string
	Image       string
	Datetime    string
}

func (o *Response) With(m *models.ArcadeSwiper) *Response {
	o.Id = m.Id
	o.Enabled = m.Enabled
	o.EnabledFlag = m.Enabled.Flag()
	o.EnabledText = m.Enabled.Text()
	o.EnabledYes = m.Enabled.IsYes()
	o.Sort = m.Sort
	o.Title = m.Title
	o.Image = m.Image
	o.Datetime = m.CreatedAt.Time().Format("06/01 15:04")
	return o
}
